package com.ls.fw.imgserver.handler;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ls.fw.imgserver.exception.ImageOperateException;
import com.ls.fw.web.core.servlet.BaseServlet.SubmitType;

public interface RequestHandler {

	public static final String STATUS_CODE = "status";
	
	public static final String RESULT = "result";
	
	public static final String MSG = "msg";
	
	
	/**
	 * 处理请求
	 * @author Defender 
	 * 2014年6月18日下午8:39:02
	 * @param submitType
	 * @param request
	 * @param response
	 * @throws ImageOperateException
	 * @throws IOException 
	 * @throws ServletException 
	 */
	public void handl(SubmitType submitType,
			HttpServletRequest request, HttpServletResponse response) throws ImageOperateException, ServletException, IOException;


	/**
	 * 剪切图片
	 * @author Defender 
	 * 2014年6月18日下午8:39:19
	 * @param request
	 * @param response
	 * @throws ImageOperateException
	 */
	public void cut(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException;

	
	/**
	 * 删除图片
	 * @author Defender 
	 * 2014年6月18日下午8:39:29
	 * @param request
	 * @param response
	 * @throws ImageOperateException
	 */
	public void del(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException;
	
	
	/**
	 * 重命名图片
	 * @author Defender 
	 * 2014年6月18日下午8:39:38
	 * @param request
	 * @param response
	 * @throws ImageOperateException
	 */
	public void rename(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException;
	
	/**
	 * 更改图片大小
	 * @author Defender 
	 * 2014年6月18日下午8:40:16
	 * @param request
	 * @param response
	 * @throws ImageOperateException
	 */
	public void resize(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException;
	
	
	/**
	 * 图片旋转
	 * @author Defender 
	 * 2014年6月18日下午8:40:27
	 * @param request
	 * @param response
	 * @throws ImageOperateException
	 */
	public void rotate(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException;
	
	
	/**
	 * 显示
	 * @author Defender 
	 * 2014年6月18日下午8:40:39
	 * @param request
	 * @param response
	 * @throws ImageOperateException
	 * @throws IOException 
	 * @throws ServletException 
	 */
	public void show(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException, ServletException, IOException;
	
	
	/**
	 * 添加水印
	 * @author Defender 
	 * 2014年6月18日下午8:40:57
	 * @param request
	 * @param response
	 * @throws ImageOperateException
	 */
	public void watermark(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException;

	
	public void move(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException;

	public void copy(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException;

	public void format(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException;

	
	/**
	 * 缩放
	 * @author Defender 
	 * 2014年6月21日上午1:00:03
	 * @param request
	 * @param response
	 * @throws ImageOperateException
	 */
	public void scale(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException;

	public void down(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException, ServletException, IOException;

	public void upload(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException, ServletException, IOException;

	public void detect(HttpServletRequest request, HttpServletResponse response)throws ImageOperateException, ServletException, IOException;

}
